package de.koller.worlders.engine.tiles.landscape.level;

import de.koller.oceanFramework.util.ColorIntUtil;
import de.koller.worlders.WorldersRoot;
import de.koller.worlders.engine.entity.plattform.SolidPlattform;
import de.koller.worlders.engine.entity.zone.SkyZone;
import de.koller.worlders.engine.tiles.landscape.IGenerate;
import de.koller.worlders.engine.tiles.landscape.LandscapeGenerator;
import java.awt.image.BufferedImage;

public class NatureFlat extends LandscapeGenerator {

	public NatureFlat( WorldersRoot wroot ) {
		super( wroot );
	}

	@Override
	public IGenerate generate( long segX, long segY, BufferedImage map, BufferedImage light ) {
		for( int tx = 0; tx < map.getWidth(); tx++ )
			for( int ty = 0; ty < map.getHeight(); ty++ ) {
				if( ty < 70 ) {
					map.setRGB( tx, ty, ColorIntUtil.getIntColor( SkyZone.GEN_ID, 0, 0xff, 0xff ) );
				} else {
					map.setRGB( tx, ty, ColorIntUtil.getIntColor( SolidPlattform.GEN_ID, 4, 0xff, 0xff ) );
					light.setRGB( tx, ty, 0xff000000 );
				}
			}
		
		return this;
	}
	
}
